From: Adel Gadllah Date: Tue, 23 Mar 2010 19:22:46 +0000 (+0100) Subject: [runDialog] Don't add duplicates to the history X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~1013^2^2~10258 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=aefa8af60ef463fb125c60603f8683f8457ffd23;p=gnome-shell.git [runDialog] Don't add duplicates to the history When the user runs the same command as the last one saved there is no need to save it again, otherwise we the history might end up having lots of dupes which makes searching for an old command harder. https://bugzilla.gnome.org/show_bug.cgi?id=613731 --- diff --git a/js/ui/runDialog.js b/js/ui/runDialog.js index 403e6df6f..ca2fb262e 100644 --- a/js/ui/runDialog.js +++ b/js/ui/runDialog.js @@ -330,8 +330,10 @@ RunDialog.prototype = { _run : function(input, inTerminal) { let command = input; - this._history.push(input); - this._saveHistory(); + if (this._history.length > 0 && this._history[this._history.length - 1] != input) { + this._history.push(input); + this._saveHistory(); + } this._commandError = false; let f;